{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "67edfa3d",
   "metadata": {},
   "outputs": [],
   "source": [
    "info = [\n",
    "    \"stu1801\":\"ziqi\" ,\n",
    "    \"stu1802\":\"xiaofang\" , \n",
    "    \"stu1803\":\"liuyu\" ,\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d6e20f42",
   "metadata": {},
   "outputs": [],
   "source": [
    "info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ebcef4fc",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 循环遍历每一个字典\n",
    "# i 是 item 在字典循环中打印的是什么？  key\n",
    "# 我想循环遍历整个内容怎么做？\n",
    "for i in info:\n",
    "    print(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "eb005d03",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 循环遍历整个字典的 items\n",
    "for k,v in info. items():\n",
    "    print(k,v)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "84dbeb1e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 实践1： stu1801 中 取出数字， 作为新的字典key\n",
    "new_info = {}\n",
    "for k,v in info.item():\n",
    "    # 用字典新增的方式创建字典\n",
    "    new_info[k[3:]] = v."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
